import request from '@/utils/request'

//设置   get 查看数据 post 提交数据
//ident  system 基础设置   currency 通用设置  sms 短信设置 serviceCharge服务费设置
//获取网站授权信息
export function getAuthInfo (data) {
  return request({
    url: 'channel/cloud/get-auth-info',
    method: 'post',
    data
  })
}
//网站激活码激活
export function checkAuth (data) {
  return request({
    url: 'channel/cloud/check-auth',
    method: 'post',
    data
  })
}
//网站登录
export function htLoginin (data) {
  return request({
    url: 'channel/login/loginin',
    method: 'post',
    data
  })
}
export function getConfig (params) {
  return request({
    url: 'channel/config/config',
    method: 'get',
    params
  })
}
export function getConfig2 (params) {
  return request({
    url: 'channel/shop/merchant-config',
    method: 'get',
    params
  })
}
export function postConfig2 (data) {
  return request({
    url: 'channel/shop/merchant-config',
    method: 'post',
    data
  })
}
export function getConfig3 (params) {
  return request({
    url: 'channel/mini-upload/config',
    method: 'get',
    params
  })
}
export function postConfig3 (data) {
  return request({
    url: 'channel/mini-upload/config',
    method: 'post',
    data
  })
}
export function postConfig (data) {
  return request({
    url: 'channel/config/config',
    method: 'post',
    data
  })
}
export function getAlipayCode (params) {
  return request({
    url: 'channel/config/get-code',
    method: 'get',
    params
  })
}

//商家设置 get 查看数据 post 提交数据
//ident  delivery 配送设置   advanceSet 预订单设置  takeOutSet 外卖设置-
export function getStoreConfig (params) {
  return request({
    url: 'channel/config/store-config',
    method: 'get',
    params
  })
}

export function postStoreConfig (data) {
  return request({
    url: 'channel/config/store-config',
    method: 'post',
    data
  })
}

//页面路径复制 -发布渠道小程序公众号配置
export function getPage (params) {
  return request({
    url: 'channel/config/get-page',
    method: 'get',
    params
  })
}

//一键获取订阅消息
export function getMiniTemplates (data) {
  return request({
    url: 'channel/config/get-mini-templates',
    method: 'post',
    data
  })
}

//操作员和角色管理
//获取用户列表
export function getUserList (params) {
  return request({
    url: 'channel/user/get-user-list',
    method: 'get',
    params
  })
}

//用户新增及保存
export function userSave (data) {
  return request({
    url: 'channel/user/user-save',
    method: 'post',
    data
  })
}

//删除用户
export function userDel (data) {
  return request({
    url: 'channel/user/user-del',
    method: 'post',
    data
  })
}

//启用禁用用户
export function changeUser (data) {
  return request({
    url: 'channel/user/change-user',
    method: 'post',
    data
  })
}

//获取角色列表
export function getRoleList (params) {
  return request({
    url: 'channel/role/get-role-list',
    method: 'get',
    params
  })
}

//角色新增及保存
export function roleSave (data) {
  return request({
    url: 'channel/role/role-save',
    method: 'post',
    data
  })
}
//角色编辑
// export function getRoleInfo(params) {
//     return request({
//         url: "channel/role/get-role-info",
//         method: "get",
//         params,
//     });
// }
//权限列表
export function authRole (params) {
  return request({
    url: 'channel/role/auth-role',
    method: 'get',
    params
  })
}

//删除角色
export function roleDel (data) {
  return request({
    url: 'channel/role/role-del',
    method: 'post',
    data
  })
}

//启用禁用角色
export function changeRole (data) {
  return request({
    url: 'channel/role/change-role',
    method: 'post',
    data
  })
}

//获取指定管理员的信息
export function getUserInfo (data) {
  return request({
    url: 'channel/user/get-user-info',
    method: 'post',
    data
  })
}

//获取阿里云Bucket--附件上传页面
export function getBucket (data) {
  return request({
    url: 'channel/config/get-bucket',
    method: 'post',
    data
  })
}

//短息设置测试发送短信
export function testTel (params) {
  return request({
    url: 'channel/message/test-tel',
    method: 'get',
    params
  })
}

//一键获取订单提醒消息
export function getStoreTemplates (data) {
  return request({
    url: 'channel/config/get-store-templates',
    method: 'post',
    data
  })
}

//新订单通知 发送订单提醒测试
export function sendMiniTemplates (data) {
  return request({
    url: 'channel/config/send-store-templates',
    method: 'post',
    data
  })
}

//获取公告列表
export function getNoticeList (params) {
  return request({
    url: 'channel/notice/get-notice-list',
    method: 'get',
    params
  })
}

//获取帮助中心列表
export function getHelpList (params) {
  return request({
    url: 'channel/notice/get-help-list',
    method: 'get',
    params
  })
}

//公告保存及修改
export function noticeSave (data) {
  return request({
    url: 'channel/notice/notice-save',
    method: 'post',
    data
  })
}

//帮助中心新增及修改
export function helpSave (data) {
  return request({
    url: 'channel/notice/help-save',
    method: 'post',
    data
  })
}

//公告启用禁用
export function changeNotice (data) {
  return request({
    url: 'channel/notice/change-notice',
    method: 'post',
    data
  })
}

//公告中心删除
export function noticeDel (data) {
  return request({
    url: 'channel/notice/notice-del',
    method: 'post',
    data
  })
}

//帮助启用禁用
export function changeHelps (data) {
  return request({
    url: 'channel/notice/change-helps',
    method: 'post',
    data
  })
}

//帮助中心删除
export function helpsDel (data) {
  return request({
    url: 'channel/notice/helps-del',
    method: 'post',
    data
  })
}

//获取运营资讯列表
export function getInformationList (params) {
  return request({
    url: 'channel/information/get-information-list',
    method: 'get',
    params
  })
}

//删除运营资讯
export function informationDel (data) {
  return request({
    url: 'channel/information/information-del',
    method: 'post',
    data
  })
}

//运营资讯保存及修改
export function informationSave (data) {
  return request({
    url: 'channel/information/information-save',
    method: 'post',
    data
  })
}
//运营资讯修改
export function getInformationSave (params) {
  return request({
    url: 'channel/information/information-save',
    method: 'get',
    params
  })
}
//启用禁用运营资讯
export function changeInformation (data) {
  return request({
    url: 'channel/information/change-information',
    method: 'post',
    data
  })
}
//缓存设置获取
export function getcacheSet (params) {
  return request({
    url: 'channel/config/cache-set',
    method: 'get',
    params
  })
}
//缓存设置提交
export function PostcacheSet (data) {
  return request({
    url: 'channel/config/cache-set',
    method: 'post',
    data
  })
}
//获取小程序二维码
export function getCode (params) {
  return request({
    url: 'channel/config/get-code',
    method: 'get',
    params
  })
}
//小程序上传判断版本
export function getEdition (params) {
  return request({
    url: 'channel/mini-upload/get-edition',
    method: 'get',
    params
  })
}
//获取登录码
export function getLoginCode (data) {
  return request({
    url: 'channel/mini-upload/get-login-code',
    method: 'post',
    data
  })
}
//获取登录状态
export function getLoginStatus (data) {
  return request({
    url: 'channel/mini-upload/get-login-status',
    method: 'post',
    data
  })
}
//获取预览码
export function preview (params) {
  return request({
    url: 'channel/mini-upload/preview',
    method: 'get',
    params
  })
}
//小程序列表
export function wxappList (params) {
  return request({
    url: 'channel/config/wxapp-list',
    method: 'get',
    params
  })
}
export function getCoordinate (params) {
  return request({
    url: 'channel/shop/get-coordinate',
    method: 'get',
    params
  })
}
//获取版权
export function getCopy (params) {
  return request({
    url: 'channel/config/get-power',
    method: 'get',
    params
  })
}
//保存饿了么商家id
export function saveEleStoreId (data) {
  return request({
    url: 'channel/ele/save-ele-store-id',
    method: 'post',
    data
  })
}
//查看饿了么商家id
export function getSaveEleStoreId (params) {
  return request({
    url: 'channel/ele/save-ele-store-id',
    method: 'get',
    params
  })
}
//获取饿了么授权地址
export function eleOauth (params) {
  return request({
    url: 'channel/ele/ele-oauth',
    method: 'get',
    params
  })
}
//获取商家信息
export function getEleStore (params) {
  return request({
    url: 'channel/ele/get-ele-store',
    method: 'get',
    params
  })
}

//xk支付宝门店
export function getAliSaveStore (params) {
  return request({
    url: 'channel/config/ali-save-store',
    method: 'get',
    params
  })
}
//保存支付宝门店
export function postAliSaveStore (data) {
  return request({
    url: 'channel/config/ali-save-store',
    method: 'post',
    data
  })
}

//更新记录
export function getUpContent (params) {
  return request({
    url: 'channel/notice/get-up-content',
    method: 'get',
    params
  })
}
export function userList (params) {
  return request({
    url: 'channel/index/user-list',
    method: 'get',
    params
  })
}
export function getMessageList (params) {
  return request({
    url: 'channel/config/get-message-list',
    method: 'get',
    params
  })
}
